package example_09.demo_02;

public class demo_02 {
    public static void main(String[] args) {
        String a = "aaddajkllllkkjkjjjjklllldfn,mfd";
        StringBuilder swap=new StringBuilder();
        char t=' ';
        for (int i=0;i<a.length();i++){
            var c =a.charAt(i);
            if (t==c){
                continue;
            }
            else {
                t=c;
                swap.append(c);
            }
        }
        System.out.println(swap);
    }
}
